#include <stdio.h>
#include <stdlib.h>
#include "build_single_book.h"
#include "../config/config.h"
#define MAX_COMMAND_LENGTH 1024
/* 
    BuildSingleBook
        Build a book 
*/
int BuildSingleBook(const char *src_path, const char *target_path, Config *config)
{
    char command[MAX_COMMAND_LENGTH] = {};
    if (NULL == config)
    {
        return -1;
    }
    sprintf(command, "%s build %s -d %s", GetConfigValue(config, MDBOOK_PATH), src_path, target_path);
    return system(command);
}